import request from '@/utils/request'

//查询用户列表
export function getUserList(params) {
	return request({
		method: 'get',
		url: 'tbSysUser/queryPageList',
		headers: { userButton: '14875431e22c4fefb05611b6525ce2dd' },
		params
	})
}

//添加用户
export function addedUser(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/add',
		headers: { userButton: 'ba9896fc77074fcead8b591273a84bf6' },
		data
	})
}

//修改用户
export function updateUser(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/update',
		headers: { userButton: 'e5c5760c55c14cbe93bd5b4b9b2fb6ce' },
		data
	})
}

//删除用户
export function deleteUser(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/delete',
		headers: { userButton: 'b8973a58d6894b89ae84682994f0bb49' },
		data
	})
}

//用户详情
export function userDetail(id) {
	return request({
		method: 'get',
		url: '/tbSysUser/queryById/' + id,
		headers: { userButton: '4353ad3a2e2e4efb83bc0dcc23366d72' }
	})
}

//个人信息修改
export function updateUserBase(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/updateBase',
		headers: { userButton: 'a6349720ebf44c8c88e4b1e26d36486d' },
		data
	})
}

//审核用户
export function auditUser(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/audit',
		headers: { userButton: '89e66f5fb0414ca1b632e288848899e4' },
		data
	})
}

//封禁/恢复用户
export function banAndRecoveryUser(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/banAndRecovery',
		headers: { userButton: '9bb78dfd86374296a4cd25d9f8cb0d8a' },
		data
	})
}

//修改用户密码
export function updateUserPassword(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/updateAllPassword',
		headers: { userButton: 'f06173612e61423b87b9e990db85a73a' },
		data
	})
}

//批量修改部门
export function batchUpdateDepart(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/batchUpdateDept',
		headers: { userButton: 'b1c55053ca1e42e485be7fc610856bb1' },
		data
	})
}

//批量修改用户的系统类型
export function batchUpdateUserType(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/updateBatchUserType',
		headers: { userButton: '201b7cfc2471496eb511658e54b03bf0' },
		data
	})
}

//设置用户图片
export function updateUserAvatar(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/updatePic',
		headers: { userButton: 'fcda49d07c6441b58f014453a2469776' },
		data
	})
}

//修改密码 - 需要旧密码
export function updatePassNeedOld(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/updatePassword',
		headers: { userButton: '38011b9d09a74431a6125e79ad4a52c5' },
		data
	})
}

//登录成功的调用
export function loginSuccess() {
	return request({
		method: 'get',
		url: 'tbSysUser/addUserInfo',
		headers: { userButton: '626364c8d47443fd90ee55ab0d1b9b48' }
	})
}

//通过用户查询角色信息
export function getRoleByUser(id) {
	return request({
		method: 'get',
		url: 'tbSysUserRole/queryByUserId/' + id,
		headers: { userButton: 'cf05f9aa8c0146ca9fb268c8afd06b86' }
	})
}

//更新用户角色
export function updateUserRole(data) {
	return request({
		method: 'post',
		url: 'tbSysUserRole/addForUser',
		headers: { userButton: '17e111df25d84aa4a929eaa281a2812c' },
		data
	})
}

//开启/取消所有用户强制修改密码
export function forceUpdateAllUserPassword(isForce) {
	return request({
		method: 'post',
		url: 'tbSysUser/allForceUpdatePassword/' + isForce,
		headers: { userButton: '4d42454a662a4571a9c948f7de153460' }
	})
}

//修改是否强制修改密码
export function forceUpdateUserPassword(data) {
	return request({
		method: 'post',
		url: 'tbSysUser/forceUpdatePassword',
		headers: { userButton: '8d9bb9c3bfdb4064826b7e84c1830032' },
		data
	})
}